/* Copyright (C) 2021 Rain */

/* This file is part of Panda. */

/* 
  Cunix is free software: you can redistribute it and/or modify 
  it under the terms of the GNU General Public License as published by 
  the Free Software Foundation, either version 3 of the License, or 
  (at your option) and later version. 
*/

/*
  Panda is distributed in the hope that it will be useful, 
  but WITHOUT ANY WARRANTY; without even the implied warranty of 
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
  GNU General Public License for more details. 
*/

/*
  You should have received a copy of the GNU General Public License 
   along with Panda. If not, see <https://www.gnu.org/licenses/>.  
*/




#ifndef __SYNTAX_H__
#define __SYNTAX_H__

#include <sys/types.h>


/* max word length */
#define MAX_WORD_LEN 64




struct panda_syn_obj {
	/* name of function or variable */
	char *name;

	/* value (number) */
	__uint64_t value;

	__uint8_t type;

	/* point to object (panda_obj_var, panda_obj_func etc. ) */
	void *object;
};


struct panda_obj_name {
	__uint64_t name_len;
	char *name;

	/* class of this variable/function */
	struct panda_obj_class *father_class;
	struct panda_syn_obj *syntax_obj;
};


struct panda_obj_class {
	__uint64_t name_len;
	char *class_name;

	/* functions in this class */
	__uint64_t func_count;
	struct panda_obj_func *functions;

	struct panda_syn_obj *syntax_obj;
};


struct panda_obj_keyword {
	__uint64_t keyword_type;

	struct panda_syn_obj *syntax_obj;
};



struct panda_obj_operator {
	/* operator */
	char operator;

	struct panda_syn_obj *syntax_obj;
};


/* right value (like 12345) */
struct panda_obj_rvalue {
	signed long value;

	struct panda_syn_obj *syntax_obj;
};


#endif

